<!DOCTYPE html>
<html>
	<head>
		<title>设置个人资料</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
		<script src="/js/jquery/jquery.min.js"></script>
		<script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
		<link rel="stylesheet" href="/css/reset.css"/>
		<link rel="stylesheet" href="/css/myStrategyComment.css"/>
		<script src="/js/plugins/jrender/jrender.min.js"></script>
		<link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
		<script src="/js/plugins/dialog2/dialog.min.js"></script>
		<script src="/js/plugins/form/jquery.form.js"></script>
		<script type="text/javascript" src="/js/plugins/jquery-validation-1.8.1/jquery.validate.js"></script>
		<script type="text/javascript" src="/js/plugins/jquery-validation-1.8.1/localization/messages_cn.js"></script>
		<script src="/js/common.js"></script>
		<script src="/js/checkLogin.js"></script>
		<script src="/js/queryAndBlank.js"></script>
		<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
		<script>
			$(function () {

                $("#infoForm").validate({
                rules: {
                name: {
                    required:true,
                    rangelength:[2,6],
                },
                    numberID: {
                    required:true,
                    rangelength:[2,6]
                }
            },
                messages: {
                    name: {
                        required:"请填写name"
                    }
                }
            });

                //获取酒店的id
                var strategyId = getParams().id;
                //根据酒店点的id查询信息
                $.get(baseUrl+"/grogshops/"+strategyId+"/room",function (data) {
                    console.log(data);
                    $.each(data,function (index, ele) {
                        console.log(ele);
                        $(".grogshopName").renderValues({list:ele})
                        $(".room").renderValues({list:ele})
                        $("#hidden").renderValues({list:ele})
                    })
                })

                //给时间选择框绑定点击事件,弹出日历
                $("#infoForm input[name='checkInTime']").click(function () {
                    WdatePicker({
                        readOnly: true, //只读
                        // maxDate:  '<%=DateTime.Now.Date.ToString("yyyy-MM-dd")%>' //设置最大可选时间
                        minDate: new Date()
                    });
                });

                //给时间选择框绑定点击事件,弹出日历
                $("#infoForm input[name='leaveTime']").click(function () {
                    WdatePicker({
                        readOnly: true, //只读
                        // maxDate:  '<%=DateTime.Now.Date.ToString("yyyy-MM-dd")%>' //设置最大可选时间
                        minDate: new Date()
                    });
                });

                $('#saveBtn').click(function () {
                    $('#infoForm').ajaxSubmit({
                        url:baseUrl+"/orderForms",
                        success:function (data) {
                            $(document).dialog({
                                titleText: '温馨提示',
                                content: '亲，你的酒店订单预定成功,3秒后跳到主页面',
                                autoClose:3000
                            });
                            window.location.href = "/index.html";
                        }
                    });
                });

			});


		</script>
	</head>

	<body>

		<div class="search-head">
			<div class="row nav-search">
				<div class="col">
					<a href="javascript:window.history.go(-1);">
						<span>取消</span>
					</a>
				</div>
				<!--<div class="col" style="float: contour">
					<span style="float: contour">填写个人订单</span>
				</div>-->
				<div class="col" >
					<a href="#" id="saveBtn" >
						<span>提交</span>
					</a>
				</div>
			</div>
		</div>

		<div class="container info">
			<div class="grogshopName">
				<span >
					<nobr >
					<h6 style="float: left;color: #00aa00">填写个人订单:</h6>
					<p style="float: right" render-html="list.grogshopName"></p>
					</nobr><br>
				</span>
			</div>
			<form id="infoForm" method="post">
				<div id="hidden">
				<input type="hidden" name="_method" value="put">
				<!--隐藏域酒店id-->
				<input type="hidden" name="grogshop.id" render-value="list.id">
				</div>
				<h6 >预定信息</h6>
				入住时间<input type="text"  name="checkInTime"  class=" badge-pill" placeholder="入住时间" style="width: 130px;">
				离开时间<input type="text"  name="leaveTime"  class=" badge-pill" placeholder="截止时间" style="width: 130px;"><br>
				<div class="room">
				房间类型<select render-loop="list.grogshopRoom">
							<option >普通</option>
							<option>豪华</option>
						</select><br>
				<span>
				房费总计<input type="text"  name="money" render-value="list.grogshopRoom.price" class=" badge-pill" style="width: 50px;" readonly>￥<br>
				</span>
				</div>
				<h>
					<hr>
				</h>
				<h>入住信息</h><br><br>
				入住姓名<input type="text" id="name"  name="name" class="badge-pill" placeholder="请填写实际入住人姓名"><br>
				证件类型<input type="text" id="numberID" name="numberID" class="badge-pill" placeholder="身份证"><br>
				手机号码<input type="text" name="phone" class="badge-pill" placeholder="请填写手机号"><br>
				补充说明<textarea name="commend" class="form-control" rows="5" placeholder="若有特殊要求请说明，字数在50以内"></textarea>
			</form>
			<h6 style="color: #00bbd3">扣款说明：</h6>
			<span>
				<p style="color: #00bbd3">
骡窝窝会根据您的付款方式进行订单全款扣除和预授权限定，如订单不确认将解除预授权或全额退款至您的支付账户。
· 订单一经预订成功，不可变更/取消，如未入住将扣除全额房费 ,订单是否生效以骡窝窝最终通知为准。
				</p>
			</span>
		</div>
		
		
		
	</body>
</html>
